const Router = require("koa-router");
const { verifyToken } = require("../middeleware/auth.middleware");
const { getUserList } = require("../controller/user.controller");
const { getUserInfo } = require("../controller/user.controller");
const { updateUser, deleteUser } = require("../controller/user.controller");

const userRouter = new Router({ prefix: "/users" });

userRouter.get("/:name", verifyToken, getUserInfo);
userRouter.get("/", verifyToken, getUserList);
userRouter.post("/:id", verifyToken, updateUser);
// delete以为采用 简单cors 跨域不了 先不修改了
userRouter.get("/delete/:id", verifyToken, deleteUser);

module.exports = userRouter;
